package com.aistar.mapper;

import com.aistar.pojo.Product;
import com.aistar.pojo.ProductExample;
import com.aistar.pojo.ProductWithBLOBs;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface ProductMapper {

    //多条件查询并按名字默认排序
    public List<Product> selectAllProductOrderByName(@Param("keyword")String keyword,
                                                     @Param("method")String method,
                                                     @Param("days")Integer days,
                                                     @Param("startCity")String startCity,
                                                     @Param("feature")String feature,
                                                     @Param("minPrice")Float minPrice,
                                                     @Param("maxPrice")Float maxPrice
    );
    //多条件查询并按价格升序
    public List<Product> selectAllProductOrderByPrice(@Param("keyword")String keyword,
                                                      @Param("method")String method,
                                                      @Param("days")Integer days,
                                                      @Param("startCity")String startCity,
                                                      @Param("feature")String feature,
                                                      @Param("minPrice")Float minPrice,
                                                      @Param("maxPrice")Float maxPrice
    );
    //多条件查询并按价格降序
    public List<Product> selectAllProductOrderByPriceDesc(@Param("keyword")String keyword,
                                                          @Param("method")String method,
                                                          @Param("days")Integer days,
                                                          @Param("startCity")String startCity,
                                                          @Param("feature")String feature,
                                                          @Param("minPrice")Float minPrice,
                                                          @Param("maxPrice")Float maxPrice
    );
    //多条件查询并按销量降序
    public List<Product> selectAllProductOrderSales(@Param("keyword")String keyword,
                                                    @Param("method")String method,
                                                    @Param("days")Integer days,
                                                    @Param("startCity")String startCity,
                                                    @Param("feature")String feature,
                                                    @Param("minPrice")Float minPrice,
                                                    @Param("maxPrice")Float maxPrice
    );
    //多条件查询并按产品星级降序
    public List<Product> selectAllProductOrderStar(@Param("keyword")String keyword,
                                                   @Param("method")String method,
                                                   @Param("days")Integer days,
                                                   @Param("startCity")String startCity,
                                                   @Param("feature")String feature,
                                                   @Param("minPrice")Float minPrice,
                                                   @Param("maxPrice")Float maxPrice
    );


    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Tue Apr 07 15:26:20 CST 2020
     */
    int countByExample(ProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Tue Apr 07 15:26:20 CST 2020
     */
    int deleteByExample(ProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Tue Apr 07 15:26:20 CST 2020
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Tue Apr 07 15:26:20 CST 2020
     */
    int insert(ProductWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Tue Apr 07 15:26:20 CST 2020
     */
    int insertSelective(ProductWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Tue Apr 07 15:26:20 CST 2020
     */
    List<ProductWithBLOBs> selectByExampleWithBLOBs(ProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Tue Apr 07 15:26:20 CST 2020
     */
    List<Product> selectByExample(ProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Tue Apr 07 15:26:20 CST 2020
     */
    ProductWithBLOBs selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Tue Apr 07 15:26:20 CST 2020
     */
    int updateByExampleSelective(@Param("record") ProductWithBLOBs record, @Param("example") ProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Tue Apr 07 15:26:20 CST 2020
     */
    int updateByExampleWithBLOBs(@Param("record") ProductWithBLOBs record, @Param("example") ProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Tue Apr 07 15:26:20 CST 2020
     */
    int updateByExample(@Param("record") Product record, @Param("example") ProductExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Tue Apr 07 15:26:20 CST 2020
     */
    int updateByPrimaryKeySelective(ProductWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Tue Apr 07 15:26:20 CST 2020
     */
    int updateByPrimaryKeyWithBLOBs(ProductWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Tue Apr 07 15:26:20 CST 2020
     */
    int updateByPrimaryKey(Product record);
}